import axios from "axios";

const context = "/deviceservice";

/***
 * 首页接口
 */
export function getIndexPageData(data:any){
  return axios.get(`${context}/home/index`)
}

/**
 * 新增设备
 */
export function addDevice(data: any) {
  return axios.post(`${context}/mallDevice`, data);
}

/**
 * excel 批量增加设备
 * */
export function batchAddDevice(data: any) {
  return axios.post(`${context}/mallDevice`, data);
}

/**
 * 修改设备
 * */
export function updateDevice(data: any) {
  return axios.put(`${context}/mallDevice`, data);
}

export function updateDevicePrice(data: any) {
  return axios.put(`${context}/mallDevice/price`, data);
}


/**
 * 批量删除设备
 */
export function removeDevice(data: any) {
  return axios.post(`${context}/mallDevice/batchRemove`, data);
}

/***
 * 设备解绑
 */
export function unbindDevice( data:any ) {
  return axios.post(`${context}/mallDevice/batchUnbind`, data);
}

/***
 * 设备绑定
 */
export function bindDevice( data:any ){
  return axios.post(`${context}/mallDevice/batchBind`, data);
}


/**
 * 批量修改
 */
export function batchUpdateDevice(data: any) {
  return axios.put(`${context}/mallDevice/batchConfig`, data);
}

/***
 * 获取设备分页列表
 */
export function getDevicePagination(data: any) {
  return axios.get(`${context}/mallDevice/pagination`, { params: data });
}
